home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Help / locale / help / english / sys / else.doc < prev    next >
Encoding:
Text File  |  2000-10-06  |  1.1 KB  |  44 lines

  1. ELSE
  2.  
  3. Specifies an alternative for an IF statement in a script file.
  4.  
  5. Format
  6.  
  7. ELSE
  8.  
  9. Template
  10.  
  11. (none)
  12.  
  13. Location
  14.  
  15. Internal
  16.  
  17. ELSE must be used in conjunction with the IF command. ELSE is used in an IF
  18. block of a script to specify an alternative action if the IF condition is not
  19. true. If the IF condition is not true, execution of the script jumps from the
  20. IF line to the line after ELSE; all intervening commands are skipped. If the
  21. IF condition is true, the commands immediately following the IF statement are
  22. executed up to the ELSE. Then, execution skips to the ENDIF statement that
  23. concludes the IF block.
  24.  
  25. Example:
  26.  
  27. Assume a script, called Display, contains the following block:
  28.  
  29. IF exists picfile
  30. MultiView picfile
  31. ELSE
  32. ECHO "picfile is not in this directory"
  33. ENDIF
  34.  
  35. If picfile can be found in the current directory, the MultiView program is
  36. executed and picfile is displayed on the screen.
  37.  
  38. If picfile cannot be found in the current directory, the script skips to the
  39. ECHO command. The following message is displayed in the Shell window:
  40.  
  41. picfile is not in this directory
  42.  
  43. See also: IF, ENDIF, EXECUTE
  44.